package com.ruoyi.medicine.mapper;

import com.ruoyi.medicine.domain.Cart;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface HisMedicineCartMapper {
    //根据用户ID查询购物车信息
    @Select("select * from his_medicine_cart where user_id=#{userId}")
    Cart selectHisMedicineCartByUserId(Long userId);

    @Insert("INSERT INTO his_medicine_cart values (default,#{userId},#{cart},#{remark})")
    int insertCartInfoMapper(Cart cart);
    @Update("update his_medicine_cart set cart=#{cart} where id=#{id}")
    int updateCartInfoMapper(Cart cart);
}
